package com.qsl.ssyx.home.api;

import com.qsl.ssyx.client.product.ProductFeignClient;
import com.qsl.ssyx.common.result.Result;
import com.qsl.ssyx.model.product.Category;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "微信小程序-分类")
@RestController
@RequestMapping("/api/home")
public class CategoryApiController {

    @Autowired
    private ProductFeignClient productFeignClient;


    @ApiOperation("获取所有分类信息")
    @GetMapping("category") // api/home/category
    public Result getCategoryList() {
        List<Category> categoryList = productFeignClient.findCategoryList();
        return Result.ok(categoryList);
    }


}
